@include('admin.layout.bone_header')

<div class="layui-form layui-form-pane search">

    <div class="layui-form-item">


        <label class="layui-form-label">会员ID</label>
        <div class="layui-input-inline">
            <input type="text" id="user_id" autocomplete="off" placeholder="请输入会员ID" class="layui-input">
        </div>


        <button class="layui-btn" data-type="reload">搜索</button>
    </div>
</div>


<table class="layui-hide" id="think-table" lay-filter="think-table"></table>

<script type="text/html" id="barDemo">
    @{{# if(d['status'] == 0){ }}
    <a class="layui-btn layui-btn-xs" lay-event="edit">审核</a>
    @{{# } }}
</script>

<script>

    layui.use(['table','laydate'], function () {
        let table = layui.table,
            laydate = layui.laydate;


        UI.getPageTable(table, "{{route('admin.user.users_upgrade')}}", [
            {field: 'users_upgrade_id', title: 'ID', width: 80, sort: true, fixed: 'left'}
            , {field: 'user_id', title: ' 用户ID'}
            , {field: 'b_user_id', title: ' 审核用户'}
            , {field: 'vip_level', title: ' 等级',templet:function (d){
                    let arr = ['普通','一星','二星','三星','四星','五星','六星','七星','八星','九星','十星','十一星','十二星','十三星']
                    return arr[d['vip_level']]
                }}
            , {field: 'sorts', title: ' 状态',templet:function (d){
                    let arr = ['待审核','通过','拒绝']
                    return arr[d['status']]
                }}
            , {field: 'created-at',width: 180, title: ' 时间',templet:function (d){
                    return Utils.paraseTime(d['created_at'])
                }}
            // ,{fixed: 'right',title:'操作', align:'center', toolbar: '#barDemo'}
        ]);

        table.on('tool(think-table)', function (obj) {
            let data = obj.data;
            if(obj.event === 'edit'){
                UI.openLayer("{{route('admin.widthwals.edit')}}?withdrawal_id="+data['withdrawal_id']);
            }
        });
        let $ = layui.$, active = {

        };
        $('.layui-btn-container .layui-btn').on('click', function () {
            let type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

        $('.search .layui-btn').on('click', function () {
            let type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    })


</script>


@include('admin.layout.bone_footer')
